/**
 * Descriptions 组件的主题配置
 * 
 * 基于企业级设计规范 (Descriptions.json) 的完整配置
 * 描述列表组件样式定义
 */

import type { ComponentToken } from 'antd/es/descriptions/style';

// ========== 设计 Token 常量 ==========

/**
 * 颜色相关 Token
 */
const COLOR_TOKENS = {
  labelBg: '#fafafa',
  labelColor: '#8c8c8c',
  titleColor: '#1a1a1a',
  contentColor: '#1a1a1a',
  extraColor: '#1a1a1a',
} as const;

/**
 * 间距相关 Token
 */
const SPACING_TOKENS = {
  titleMarginBottom: 12,
  itemPaddingBottom: 16,
  itemPaddingEnd: 16,
  colonMarginRight: 8,
  colonMarginLeft: 2,
} as const;

/**
 * Descriptions 完整主题配置
 */
export const descriptionsThemeConfig: Partial<ComponentToken> = {
  // ========== 颜色配置 ==========
  labelBg: COLOR_TOKENS.labelBg,
  labelColor: COLOR_TOKENS.labelColor,
  titleColor: COLOR_TOKENS.titleColor,
  contentColor: COLOR_TOKENS.contentColor,
  extraColor: COLOR_TOKENS.extraColor,

  // ========== 间距配置 ==========
  titleMarginBottom: SPACING_TOKENS.titleMarginBottom,
  itemPaddingBottom: SPACING_TOKENS.itemPaddingBottom,
  itemPaddingEnd: SPACING_TOKENS.itemPaddingEnd,
  colonMarginRight: SPACING_TOKENS.colonMarginRight,
  colonMarginLeft: SPACING_TOKENS.colonMarginLeft,
};

export const getDescriptionsTheme = (
  customConfig?: Partial<ComponentToken>
): Partial<ComponentToken> => {
  return {
    ...descriptionsThemeConfig,
    ...customConfig,
  };
};

export type { ComponentToken as DescriptionsComponentToken } from 'antd/es/descriptions/style';

